import libtcodpy as libtcod

#
# DICTIONARIES! #
#

TERRAIN = {
    0: {'type': 'floor', 'opaque': 0, 'solid': 0, 'character': '.',
        'light': libtcod.Color(190, 170, 140),
        'dark': libtcod.Color(64, 32, 0)},
    1: {'type': 'wall', 'opaque': 1, 'solid': 1, 'character': '#',
        'light': libtcod.Color(127, 101, 63),
        'dark': libtcod.Color(100, 80, 40)},
    2: {'type': 'closed door', 'opaque': 1, 'solid': 0, 'character': '+',
        'light': libtcod.Color(255, 255, 255),
        'dark': libtcod.Color(255, 255, 255)},
    3: {'type': 'open door', 'opaque': 0, 'solid': 0, 'character': '/',
        'light': libtcod.Color(255, 255, 255),
        'dark': libtcod.Color(255, 255, 255)},
}

# movement keys
move_keys = {
    libtcod.KEY_UP: (0, -1),
    libtcod.KEY_DOWN: (0, 1),
    libtcod.KEY_LEFT: (-1, 0),
    libtcod.KEY_RIGHT: (1, 0),
    libtcod.KEY_KP8: (0, -1),
    libtcod.KEY_KP2: (0, 1),
    libtcod.KEY_KP4: (-1, 0),
    libtcod.KEY_KP6: (1, 0),
    libtcod.KEY_KP9: (1, -1),
    libtcod.KEY_KP7: (-1, -1),
    libtcod.KEY_KP3: (1, 1),
    libtcod.KEY_KP1: (-1, 1),
    libtcod.KEY_KP5: (0, 0)
}

# skills that double as resources
STATS = {'strength', 'stamina', 'focus'}
# skills and the stats that govern them
SKILLS = {'strength': ('force', 'guard', 'smithing'),
          'stamina': ('accuracy', 'evasion', 'archery'),
          'focus': ('stealth', 'detection', 'lore')}

SKILL_LIST = ['force', 'guard', 'smithing', 'accuracy', 'evasion', 'archery', 'stealth', 'detection', 'lore']
SKILL_DESC = {'force': 'Hit harder',
              'guard': 'Withstand your enemies\' attacks',
              'smithing': 'Make manly stuff',
              'accuracy': 'Hit your enemies with skill and swiftness',
              'evasion': 'Float like a butterfly',
              'archery': 'Shoot stuff eventually?',
              'stealth': 'Bypass enemies\' senses and defenses',
              'detection': 'Keep your guard up',
              'lore': 'Magical stuff'}
# stats for various movement/attack types and passive regeneration
MISC_STATS = {
              'strength_heal_time': 100, 'strength_heal_count': 0,
              'stamina_heal_time': 50, 'stamina_heal_count': 0,
              'focus_heal_time': 20, 'focus_heal_count': 0,
              'resistance': 0, 'clarity':0,
              'move_time':10, 'attack_time':10,
              'lethality':1, 'daze':0, 'stun':0,
}

BONUS_SKILLS = {'sneak':{'force':-2, 'guard':-2, 'evasion':2, 'accuracy':2, 'stealth':3, 'detection':3},
                'run':{'force':3, 'guard':3, 'evasion':-1, 'accuracy':-1, 'stealth':-2, 'detection':-2},
                'normal':{'force':0, 'guard':0, 'evasion':0, 'accuracy':0, 'stealth':0, 'detection':0}
}
MOVE_STATS = {
              'sneak':{'move_time':10, 'attack_time':0},
              'run':{'move_time':-5, 'attack_time':10},
              'normal':{'move_time':0, 'attack_time':0},
}

ABILITIES = {
           'force': [('fervor', 'Fight at full strength, even while wounded.', 2),
                    ('stagger', 'Force your target off-balance.', 3),
                    ('knockback', 'Knockback if your dmg > enemy str.', 4),
            ],
           'guard': [('rebuke', 'Fully blocking slows your attackers.', 2),
                    ('counter', 'Free attack for blocking by > enemy\'s str.', 3),
            ],
            'smithing': [],
           'accuracy': [('endurance', 'Don\'t lose accuracy when tired.', 2),
            ],
           'evasion': [('second wind', 'Regain stamina when injured.', 3),
            ],
            'archery': [],
            'stealth': [],
            'detection': [],
            'lore': []
}

# constant that stealth must beat detection by in order to proc a sneak-attack
PIERCING_REQ = 3
SKILL_COST = 10
ABILITY_COST = 50


VERBS = {'normal': ('hits', 'hit'), 'sneak': ('stabs', 'stab'), 'run': ('smashes', 'smash'), 'miss': ('misses', 'miss'),
             'are': ('is', 'are')
}

MIN_LEAF_SIZE = [10,10]
MIN_ROOM_SIZE = [5,5]
MAX_ROOM_SIZE = [10,10]
SCREEN_WIDTH = 80
SCREEN_HEIGHT = 50
LIMIT_FPS = 1000
MAP_WIDTH = 60
MAP_HEIGHT = 43
PANEL_HEIGHT = 7
LOADOUT_WIDTH = 20
LOADOUT_HEIGHT = SCREEN_HEIGHT - PANEL_HEIGHT
BAR_WIDTH = 20
MSG_HEIGHT = 6
MSG_WIDTH = 30
MSG_X = 45
SIGHT_RADIUS = 10
AUTO_PICKUP = True
LINE_TRAVEL = False

EQUIPMENT_SLOTS = ['RH']
ITEMS = {
    'gold':{'name':'gold', 'character':'$'},
    'stick':{'name':'stick', 'character':'(', 'misc_stats':{'lethality':1}, 'slots':['RH'], 'weight':2}
}

UNITS = {
    'alex':{'name':'alex', 'character':'A', 'stats':{'strength':2,'stamina':2,'focus':2},'exp':30},
    'jamie':{'name':'jamie', 'character':'J', 'stats':{'strength':3,'stamina':3,'focus':3},'exp':50},
    'Unit':{'name':'Unit', 'character':'U', 'stats':{'strength': 4, 'stamina': 4, 'focus': 4}, 'exp':50},
  
}

UNIT_TABLE = [
    ['alex'],
    ['jamie'],
    ['Unit'],
]

ITEM_TABLE = [
    ['gold', 'stick'],
    ['gold'],
]